//
//  IAPHelper.h
//  ProjectL
//
//  Created by Nguyen Tan Loc on 12/8/13.
//  Copyright (c) 2013 Nguyen Tan Loc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <StoreKit/StoreKit.h>

typedef void (^RequestProductCompletionHandler)(BOOL success, NSArray *products);

@interface IAPHelper : NSObject <SKProductsRequestDelegate, SKPaymentTransactionObserver>
{
    SKProductsRequest *mProductsRequest;
    RequestProductCompletionHandler mCompletionhandler;
    NSArray *mListIdentifiers;
}

-(id) initWithProductIdentifiers:(NSArray *)identifiers;
-(void) requestProductWithCompletionHandler:(RequestProductCompletionHandler)completionHandler;
-(void) buyProduct:(NSString *)productIdentifier;
-(void) completeTransaction:(SKPaymentTransaction *) transaction;
-(void) failedTransaction:(SKPaymentTransaction *) transaction;
-(void) restoreTransaction:(SKPaymentTransaction *) transaction;

@end
